home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / simplesel / simplesel.dopus5 next >
Text File  |  1997-02-27  |  3KB  |  86 lines

  1. /*****************************************************************\
  2. *                                                                 *
  3. *  SIMPLESELECT and SIMPLEDESELECT commands for Directory Opus 5  *
  4. *                                                                 *
  5. *  Written by Timo Kaikumaa (timok@cc.tut.fi)                     *
  6. *                                                                 *
  7. *  ARexx script for Directory Opus 5.5 giving you two new         *
  8. *  select commands. To make them work, place this script into     *
  9. *  "dopus5:modules" directory.                                    *
  10. *                                                                 *
  11. *  This script was written because the original DOpus select      *
  12. *  command is rather clumsy to use, especially when deselecting   *
  13. *  files. Both "SimpleSelect" and "SimpleDeselect" open up a      *
  14. *  requester asking a filename only pattern to (de)select files.  *
  15. *                                                                 *
  16. *  The commands will operate on multiple source directories in    *
  17. *  case they were executed outside any lister context.            *
  18. *                                                                 *
  19. *  Bugs: the pattern used is not memorized like in the original   *
  20. *  select command.                                                *
  21. *                                                                 *
  22. *  Hint: try these commands in lister toolbar - use left mouse    *
  23. *  button for SimpleSelect and right button for SimpleDeselect.   *
  24. *                                                                 *
  25. \*****************************************************************/
  26.  
  27. /* $VER: simplesel.dopus5 1.2 (25.1.97)
  28. */
  29.  
  30. parse arg portname function source dest arguments
  31. address value portname
  32. options results
  33.  
  34.  
  35. /* Initialization */
  36.  
  37. if function = 'init' then do
  38.   dopus command "SimpleSelect" program "simplesel" desc "'Simple-select files'" source
  39.   dopus command "SimpleDeselect" program "simplesel" desc "'Simple-deselect files'" source
  40.   exit
  41.   end
  42.  
  43.  
  44. /* SimpleSelect */
  45.  
  46. if function = 'SimpleSelect' then do
  47.   if source ~= 0 then do
  48.     lister query source path
  49.     if RESULT = "" then exit
  50.     lister getstring source '"Enter select pattern to match filenames." 40 "*"  _OK|_Cancel'
  51.     if DOPUSRC = 0 then exit
  52.     command "source" source select include name RESULT
  53.     exit
  54.     end
  55.   else do
  56.     lister query "source" stem multi
  57.     if multi.count = 0 then exit
  58.     dopus getstring '"Enter select pattern to match filenames." 40 "*"  _OK|_Cancel'
  59.     if DOPUSRC = 0 then exit
  60.     command select include name RESULT
  61.     exit
  62.     end
  63.   end
  64.  
  65.  
  66. /* SimpleDeselect */
  67.  
  68. if function = 'SimpleDeselect' then do
  69.   if source ~= 0 then do
  70.     lister query source path
  71.     if RESULT = "" then exit
  72.     lister getstring source '"Enter deselect pattern to match filenames." 40 "" _OK|_Cancel'
  73.     if DOPUSRC = 0 then exit
  74.     command "source" source select exclude name RESULT
  75.     exit
  76.     end
  77.   else do
  78.     lister query "source" stem multi
  79.     if multi.count = 0 then exit
  80.     dopus getstring '"Enter deselect pattern to match filenames." 40 "*"  _OK|_Cancel'
  81.     if DOPUSRC = 0 then exit
  82.     command select exclude name RESULT
  83.     exit
  84.     end
  85.   end
  86.